/**
 * Copyright (c) 2017 ShopJsp. All Rights Reserved.
 * ============================================================================
 * 版权所有 2011 - 今 北京华宇盈通科技有限公司，并保留所有权利。
 * ----------------------------------------------------------------------------
 * 提示：在未取得SHOPJSP商业授权之前，您不能将本软件应用于商业用途，否则SHOPJSP将保留追究的权力。
 * ----------------------------------------------------------------------------
 * 官方网站：http://www.shopjsp.com
 * ============================================================================
 * @author 张丁方
 * @CreateTime 2017-4-25 17:16:58
 */
package com.hyyt.shopjsp.store.info.service.imp;

import java.util.Collection;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import com.hyyt.shopjsp.store.info.pojo.ShopShopInfo;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;

import com.hyyt.shopjsp.store.info.dao.ShopShopsShopInfoDAO;
import com.hyyt.shopjsp.store.info.pojo.ShopShopsShopInfo;
import com.hyyt.shopjsp.store.info.service.IShopShopsShopInfoService;

@Service
public class ShopShopsShopInfoService implements IShopShopsShopInfoService {
    private static final Logger logger = Logger.getLogger(IShopShopsShopInfoService.class);

    @Resource
    private ShopShopsShopInfoDAO shopShopsShopInfoDAO;

    /**
     * 保存SHOP_商城与店铺关系
     *
     * @param shopShopsShopInfo SHOP_商城与店铺关系
     * @return 保存后的SHOP_商城与店铺关系
     */
    @Override
    public void saveShopShopsShopInfo(ShopShopsShopInfo shopShopsShopInfo) {
        shopShopsShopInfoDAO.insert(shopShopsShopInfo);
    }

    /**
     * 更新SHOP_商城与店铺关系
     *
     * @param shopShopsShopInfo SHOP_商城与店铺关系
     * @return 更新后的SHOP_商城与店铺关系
     */
    @Override
    public void updateShopShopsShopInfo(ShopShopsShopInfo shopShopsShopInfo) {
        shopShopsShopInfoDAO.update(shopShopsShopInfo);
    }

    /**
     * 删除指定ID的SHOP_商城与店铺关系
     *
     * @param id SHOP_商城与店铺关系ID
     */
    @Override
    public void deleteShopShopsShopInfo(Integer id) {
        shopShopsShopInfoDAO.delete(id);
    }

    /**
     * 删除指定ID集合的SHOP_商城与店铺关系
     *
     * @param ids SHOP_商城与店铺关系ID集合
     */
    @Override
    public void deleteShopShopsShopInfo(Collection<Integer> ids){
        shopShopsShopInfoDAO.batchDelete(ids);
    }

    /**
     * 根据ID加载一个SHOP_商城与店铺关系
     *
     * @param id SHOP_商城与店铺关系ID
     * @return SHOP_商城与店铺关系
     */
    @Override
    public ShopShopsShopInfo loadShopShopsShopInfo(Integer id) {
        return shopShopsShopInfoDAO.load(id);
    }

    /**
     * 查询所有的SHOP_商城与店铺关系，通常有最多取30000条记录的限制
     *
     * @return 所有的SHOP_商城与店铺关系，通常有最多取30000条记录的限制
     */
    @Override
    public List<ShopShopsShopInfo> queryAllShopShopsShopInfo() {
        return shopShopsShopInfoDAO.queryAll();
    }

    /**
     * 查询SHOP_商城与店铺关系
     *
     * @param params 查询参数，为key-value形式
     * @return SHOP_商城与店铺关系集合
     */
    @Override
    public List<ShopShopsShopInfo> queryShopShopsShopInfo(Map<String, Object> params) {
        return shopShopsShopInfoDAO.query(params);
    }

    /**
     * 查询SHOP_商城与店铺关系
     *
     * @param params   查询参数，没有则传null,分页参数key为“sortColumns”
     * @param startRow 起始行数（不含起始行的数据）
     * @param rowSize  要查询记录数
     * @return SHOP_商城与店铺关系集合
     */
    @Override
    public List<ShopShopsShopInfo> queryShopShopsShopInfo(Map<String, Object> params, int startRow, int rowSize) {
        return shopShopsShopInfoDAO.query(params, startRow, rowSize);
    }

    /**
     * 统计SHOP_商城与店铺关系
     *
     * @param params 查询参数，没有则传null,分页参数key为“sortColumns”
     * @return 结果集记录数
     */
    @Override
    public int countShopShopsShopInfo(Map<String, Object> params) {
        return shopShopsShopInfoDAO.count(params);
    }

	@Override
	public List<ShopShopsShopInfo> queryShopsShopInfoList(Map<String, Object> params) {
		return shopShopsShopInfoDAO.query("queryShopsShopinfoList", params);
	}

	/**
	 * 查到店铺集合
	 * @param params
	 * @return
	 */
	@Override
	public List<ShopShopsShopInfo> queryShopShopInfo(Map<String, Object> params) {
		return shopShopsShopInfoDAO.query("queryShopShopinfo", params);
	}

    /**
     * 查出热门商圈热门店铺结合
     * @param params
     * @return
     */
    @Override
    public List<Map<String ,Object>> queryShopsShopInfoMap(Map <String , Object> params, int startRow, int rowSize){
        return shopShopsShopInfoDAO.query("queryShopsShopInfoMap",params,startRow,rowSize);
    }

    /**
     * 查出店铺不在商铺的集合
     * @param params
     * @return
     */
    @Override
    public List<ShopShopInfo> shopInfoNotInShopsList(Map <String , Object> params, int startRow, int rowSize){
        return shopShopsShopInfoDAO.query("shopInfoNotInShopsList",params,startRow,rowSize);
    }

    /**
     * 查出店铺不在商铺的数量
     * @param params
     * @return
     */
    @Override
    public int countShopInfoNotInShops(Map <String , Object> params){
        return shopShopsShopInfoDAO.count("countShopInfoNotInShops",params);
    }

}